const express = require("express");
const router = express.Router();
const blogController = require("../controllers/blogsController");
const auth = require("../middleware/auth");
// 上传博客封面
const uploadCover = require("../middleware/uploadCover");

// 创建博客文章
router.post(
  "/createBlogPost",
  auth,
  uploadCover.single("file"),
  blogController.createBlogPost
);
// 列表查询
router.get("/list", auth, blogController.getBlogList);

// 点赞
router.post("/likeBlog", auth, blogController.likeBlog);

module.exports = router;
